﻿using Fluent.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace Fluent
{
    public class KnowIssue
    {
        public static void For(int bugID, Action assertActions, bool caseDependence = false, string description = "")
        {
            try
            {
                assertActions();
            }
            catch (AssertFailedException failedException)
            {
                if (caseDependence)
                {
                    throw new AssertFailedException(string.Format("KnowIssue for {0}, Messages: {1}", bugID.ToString(), failedException.Message));
                }
                else
                {
                    Log.Error("KnowIssue for {0}, Messages: {1}", bugID.ToString(), failedException.Message);
                }
            }
        }
    }
}